import request from '@/libs/axios'

export const roles = params => {
  return request({
    url: '/roles',
    method: 'get',
    params: params
  })
}

export const editRole = params => {
  return request({
    url: '/roles/' + params.id,
    method: 'put',
    data: params
  })
}

export const permissions = params => {
  return request({
    url: '/roles/permissions/' + params.id,
    method: 'post',
    data: params
  })
}

export const getPermissions = params => {
  return request({
    url: '/roles/permissions/' + params.id,
    method: 'get',
    params: params
  })
}
